package com.kyzh.core.adapters.providers

import android.graphics.Color
import com.chad.library.adapter.base.entity.node.BaseNode
import com.chad.library.adapter.base.provider.BaseNodeProvider
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.gushenge.core.beans.Small
import com.kyzh.core.R

class SmallItemProvider() :BaseNodeProvider(){
    override val itemViewType: Int
        get() = 1

    override val layoutId: Int
        get() = R.layout.small_child_item_2
    override fun convert(helper: BaseViewHolder, item: BaseNode) {
        val data = item as Small.Data
        helper.setText(R.id.tvGame, if (data.gname.isEmpty()) context.getString(R.string.gameNotExist) else data.gname)
                .setTextColor(R.id.tvGame, if (data.gname.isNotEmpty()) context.resources.getColor(R.color.font_66) else Color.RED)
                .setText(R.id.tvName, data.role_name)
                .setText(R.id.tvLevel, "${data.level}${context.getString(R.string.level)}")
    }

}